#pragma once
#include "Allegro.h"
#include "Tracer.h"

class KeyInput
{
public:
	KeyInput(void);
	~KeyInput(void);

	char oldKey[KEY_MAX];

	void update();

	bool inline keyDown(int index)
      { return key[index]; }
	bool inline keyPressed(int index)
	{
		// Tracer::trace("%d %d %d\n", index, key[index], oldKey[index] ); 
		return ( key[index] && !oldKey[index] );
	}
	bool inline keyStillPressed(int index)
      { return ( key[index] && oldKey[index] ); }
	bool inline keyUp(int index)
      { return ( !key[index] && oldKey[index] ); }
	bool inline keyStillUp(int index)
      { return ( !key[index] && !oldKey[index] ); }

};
